<?php $this->placeholder('toolbar')->captureStart();?>
<?php echo $this->partial('index/toolbar/publish.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/unpublish.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/divider.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/new.phtml', 'admin', array($this->url(array('action' => 'insert')))) ?>
<?php echo $this->partial('index/toolbar/edit.phtml', 'admin', array($this->url(array('action' => 'update')))) ?>
<?php echo $this->partial('index/toolbar/divider.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/trash.phtml', 'admin', array($this->url(array('action' => 'delete')))) ?>
<?php $this->placeholder('toolbar')->captureEnd();?>

<form id="adminForm" name="adminForm" method="post" action="">
	<fieldset id="filter-bar" style="height: auto">
		<?php echo $this->partial('index/search/layout.phtml', 'admin',array ( 
			 $this->partial('index/search/all.phtml', 'admin',array('value'=>$this->search_keyword)), 	
			 $this->partial('index/search/submit.phtml', 'admin') 
		 )); ?>		
		<?php echo $this->partial('index/filter/layout.phtml', 'admin',array ( 
			 $this->partial('index/filter/publish.phtml', 'admin',array('value'=>$this->account_status,'name'=>'account_status')), 
		 )); ?>	
	</fieldset>	
	<div class="clr"> </div>
	<table class="adminlist">
		<thead>
			<tr>
				<?php echo $this->partial('index/manage/no-save-order.phtml', 'admin', array('column'=>'unit_order')); ?>
				<th width="1%"><input type="checkbox" id="checkall" /></th>
				<th><?php echo $this->partial("index/manage/header.phtml","admin",array("caption"=>"Tài khoản","column"=>account_username))?></th>
				<th>Họ tên</th>
				<th><?php echo $this->partial("index/manage/header.phtml","admin",array("caption"=>"Ngày sinh","column"=>account_birthday_time))?></th>
				<th>Địa chỉ - Quận / huyện - Tỉnh / thành phố<!--  - Quốc gia--></th>
				<th>Số điện thoại</th>
				<th><?php echo $this->partial("index/manage/header.phtml","admin",array("caption"=>"Ngày đăng kí","column"=>account_created_time))?></th>				
				<th width="5%"><?php echo $this->partial("index/manage/header.phtml","admin",array("caption"=>"Trạng thái","column"=>account_status))?></th>
				<th width="5%">Đổi mật khẩu</th>
				<th width="5%">Phân quyền</th>
				<th width="5%">Quản lý</th>
			</tr>
		</thead>
		<tbody>
		<?php if (count($this->paginator) > 0): ?>
			<?php $i = 0;$flag=""; ?>
			<?php foreach ($this->paginator as $row): ?>
			
			<?php if($flag!=$row->m_Array['group_code']){$flag=$row->m_Array['group_code'];?>
			<tr>
				<td colspan="100" style="font-weight: bold">Nhóm người dùng: <?php echo $row->m_Array['group_name']?></td>
			</tr>			
			<?php }?>
			
			<tr class='row<?php echo ($i++)%2 ?>'>
				<?php echo $this->partial('index/manage/order.phtml', 'admin', array($i)) ?>
				<?php echo $this->partial('index/manage/checkbox.phtml', 'admin', array($row->account_id)) ?>
				<td class='is_code'><?php echo $row->account_username ?></td>
				<td><?php echo $row->account_fullname ?></td>
				<td class='center'>
					<?php echo $this->partial('index/format/time.phtml', 'admin', array($row->account_birthday_time)) ?>
				</td>				
				<td>
					<?php echo $row->account_address ?> 
					<?php $tmp=Zend_Registry::get('account')->account_district->{$row->account_city}->{$row->account_district};echo $tmp!=""?" - $tmp":""; ?> 
					<?php $tmp=Zend_Registry::get('account')->account_city->{$row->account_city};echo $tmp!=""?" - $tmp":""; ?> 
					<?php //$tmp=Zend_Registry::get('account')->account_nation->{$row->account_nation};echo $tmp!=""?" - $tmp":""; ?>
				</td>
				<td class='center'><?php echo $row->account_phone ?></td>				
				<td  class='center'>
					<?php echo $this->partial('index/format/time.phtml', 'admin', array($row->account_created_time)) ?>
				</td>
				<td class="center">
					<?php echo $this->partial("index/manage/publish.phtml","admin", array($this->url(array('action' => 'publish')),$row->account_status)); ?>	
				</td>
				<td class="center">
					<?php echo $this->partial('index/manage/icon.phtml', 'admin', array("title"=>"Đổi mật khẩu","href"=>$this->url(array("action"=>"update-password","id"=>$row->account_id)),"class"=>"icon-16-locked")) ?>					
				</td>
				<td class="center">
					<?php echo $this->partial('index/manage/icon.phtml', 'admin',array("title"=>"Phân quyền","href"=>$this->url(array('action' => 'assign', 'id' => $row->account_id)) ,"class"=>"icon-16-help-security")) ?>					
				</td>
				<td class="center">				
					<?php echo $this->partial("index/manage/edit.phtml","admin", array($this->url(array('action' => 'update','id'=>$row->account_id)))); ?>
					<?php echo $this->partial("index/manage/trash.phtml","admin", array($this->url(array('action' => 'delete')))); ?>	
				</td>
			</tr>
			<?php endforeach; ?>
		<?php endif; ?>
		</tbody>
		<tfoot>
			<tr>
				<td colspan="100"><div class="container"><?php echo $this->paginationControl($this->paginator) ?> </div></td>
			</tr>
		</tfoot>
	</table>
</form>


 <script>
  /*$(document).ready(function(){
	  var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
	  $("#month").autocomplete(months, {
		  minChars: 0,
		  max: 12,
		  autoFill: true,
		  mustMatch: true,
		  matchContains: false,
		  scrollHeight: 220,
		  formatItem: function(data, i, total) {
		  // don't show the current month in the list of values (for whatever reason)
		  if ( data[0] == months[new Date().getMonth()] )
		  return false;
		  return data[0];
		  }
		  }); 
  });*/
  </script>
  
<!--   <label>Month (local):</label>
<input id="month" class="ac_input" type="text" autocomplete="off">
<input type="button" value="Get Value">
(Current month is excluded from list) -->







